{template 'public/header'}

{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_tcwq/template/public/ygcsslist.css">

<ul class="nav nav-tabs">
  <span class="ygxian"></span>
  <div class="ygdangq">当前位置:</div> 
 <li {if $type=='wait'} class="active"{/if}><a href="{php echo $this->createWebUrl('upgrade',array('type'=>wait,'state'=>1));}">待审核</a></li>
 <li  {if $type=='ok'} class="active" {/if}><a href="{php echo $this->createWebUrl('upgrade',array('type'=>ok,'state'=>2));}">已确认</a></li>
 <li  {if $type=='no'} class="active" {/if}><a href="{php echo $this->createWebUrl('upgrade',array('type'=>no,'state'=>3));}">已拒绝</a></li>
 <li  {if $type=='all'} class="active" {/if}><a href="{php echo $this->createWebUrl('upgrade',array('type'=>all));}">全部</a></li>
</ul>
<div class="row ygrow">
    <div class="col-lg-12">
        <form action="" method="get" class="col-md-3">
          <input type="hidden" name="c" value="site" />
          <input type="hidden" name="a" value="entry" />
          <input type="hidden" name="m" value="zh_tcwq" />
          <input type="hidden" name="do" value="upgrade" />
            <div class="input-group" style="width: 300px">
                <input type="text" name="keywords" class="form-control" value="{$_GPC['keywords']}" placeholder="请输入联系人名称/电话">
                <span class="input-group-btn">
                    <input type="submit" class="btn btn-default" name="submit" value="查找"/>
                </span>
            </div>
            <input type="hidden" name="token" value="{$_W['token']}"/>
           <input type="hidden" name="type" value="all"/>
        </form>
         <form action="" method="get" class="col-md-3">
          <input type="hidden" name="c" value="site" />
          <input type="hidden" name="a" value="entry" />
          <input type="hidden" name="m" value="zh_tcwq" />
          <input type="hidden" name="do" value="upgrade" />
            <div class="input-group" style="width: 100px">
                {php echo tpl_form_field_daterange('time',$_GPC['time']);}
                <span class="input-group-btn">
                    <input type="submit" class="btn btn-default" name="submit2" value="查找"/>
                     <input type="hidden" name="token" value="{$_W['token']}"/>
                       <input type="hidden" name="type" value="all"/>
                </span>
            </div><!-- /input-group -->
        </form>     
        <input type="hidden" name="token" value="{$_W['token']}"/>
    </div><!-- /.col-lg-6 -->
</div>  
<div class="main">
    <div class="panel panel-default">
        <div class="panel-heading">
            升级管理
        </div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
                <table class="yg5_tabel col-md-12">
                    <tr class="yg5_tr1">
                        <td class="col-md-1">id</td>  
                       <td class="col-md-1">所属商家</td>
                       <td class="col-md-1">联系人</td>
                          <td class="col-md-1">联系电话</td>
                        <td class="col-md-1">发布时间</td>
                          
                        <td class="col-md-1">状态</td>
                        <td class="col-md-2">操作</td>
                    </tr>
                    {loop $list $key $item}
                    <tr class="yg5_tr2">
                        <td>{$item['id']}</td>
                        <td>{$item['store_name']}</td>
                         <td>{$item['name']}</td>

                        <td>{$item['tel']}</td>
                     
                          <td>{php echo date("Y-m-d H:i:s",$item['time'])}</td>
                            
                          
                        {if $item['state']==1}
                        <td>
                            <span class="label storered">待审核</span>
                            {if $item['hb_money']>0}<span class="label storered">红包</span>{/if}
                        </td >
                        {elseif $item['state']==2}
                        <td >
                            <span class="label storeblue">已通过</span>
                            {if $item['hb_money']>0}<span class="label storered">红包</span>{/if}
                        </td>
                        {elseif $item['state']==3}
                        <td>
                           <span class="label storegrey">已拒绝</span>
                           {if $item['hb_money']>0}<span class="label storered">红包</span>{/if}
                       </td>
                       {/if} 
                       <td>
                          {if $item['state']==1}
                           <a href="{php echo $this->createWebUrl('upgrade',array('op'=>'tg','id'=>$item['id'],'type'=>$_GPC['type'],'page'=>$_GPC['page']));}"><button class="btn ygyouhui2 btn-xs">通过</button></a>
                           <a href="{php echo $this->createWebUrl('upgrade',array('op'=>'jj','id'=>$item['id'],'type'=>$_GPC['type'],'page'=>$_GPC['page']));}"><button class="btn ygshouqian2 btn-xs">拒绝</button></a>
                           {/if}
                          <a href="" class="storespan btn btn-xs" data-toggle="modal" data-target="#myModal{$item['id']}">
                              <span class="fa fa-trash-o"></span>
                              <span class="bianji">删除
                                  <span class="arrowdown"></span>
                              </span>
                          </a>
                       </td>

                   </tr>
                   <div class="modal fade" id="myModal{$item['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                      <div class="modal-dialog" role="document">
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                        </div>
                        <div class="modal-body" style="font-size: 20px">
                            确定删除么？
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <a href="{php echo $this->createWebUrl('upgrade', array('op' => 'delete', 'id' => $item['id'],'type'=>$_GPC['type'],'page'=>$_GPC['page']))}" type="button" class="btn btn-info" >确定</a>
                        </div>
                    </div>
                </div>
            </div>


            {/loop}
            {if empty($list)}
            <tr class="yg5_tr2">
            <td colspan="11">
                  暂无升级信息
              </td>
          </tr>
          {/if}
      </table>
  </div>
</div>
</div>
</div>
<div class="text-right we7-margin-top">
   {$pager}
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-0").show();
        $("#yframe-0").addClass("wyactive");

        
    })
</script>
{template 'common/footer'}